<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>华胜后台管理</title>
    <link rel="stylesheet" type="text/css" href="css/unified.css">
    <script src="plugins/layui/layui.js"></script>

    <style type="text/css">
        .searchform span{margin-left: 10px}
        .layui-table-view .layui-table td, .layui-table-view .layui-table th{padding: 0}
    </style>
</head>
<body>

    <div class="breadcrumbnav">
        <span class="layui-breadcrumb " lay-separator="·">
          <a ><cite>首页</cite></a>
          <a ><cite>库存管理</cite></a>
          <a ><cite>销售出库</cite></a>
        </span>
    </div>
    <div class="kit-doc">
        <!-- 标题 -->
        <div class="kit-doc-title">
            <fieldset>
                <legend> <a name="blockquote">出库</a>
                </legend>
            </fieldset>
        </div>
        <!-- 标题 end-->
        
        <!-- 概述 -->
        <div class="boderbox">
            <div class="rowtop">
                <button class="layui-btn addbtn openwinbtn" data-method="addmang">添加+</button>
          
                <!--<form class="layui-form searchform" action="" id="comSearchForm">
                    <div class="layui-input-inline">
                      <span class="layui-input-inline">购买单位:</span>
                      <select name="city" lay-verify="" >
                        <option value="010">彬彬木业</option>
                        <option value="021">彬彬木业</option>
                        <option value="0571" selected>layim</option>
                      </select> 
                    </div>

                    <span class="layui-input-inline">经手人:</span>
                    <select name="city" lay-verify=""  >
                      <option value="010">彬彬木业</option>
                      <option value="021">彬彬木业</option>
                      <option value="0571" selected>layim</option>
                    </select>   
                    <span class="layui-input-inline">部门:</span>
                    <select name="city" lay-verify="" >
                      <option value="010">彬彬木业</option>
                      <option value="021">彬彬木业</option>
                      <option value="0571" selected>layim</option>
                    </select>   
                    <span >付款日期:</span>
                    
                      <input type="text" class=" paydata" id="test1">  
                   
                    
                    <span class="layui-input-inline">发货仓库:</span>
                    <select name="city" lay-verify="" >
                      <option value="010">彬彬木业</option>
                      <option value="021">彬彬木业</option>
                      <option value="0571" selected>layim</option>
                    </select> 
                </form> -->
            </div>
           
            <div class="layui-tab-content notab">
                <div class="layui-tab-item layui-show">
                    <table  class="layui-table " lay-filter="table100" id="SMtable"></table>
                </div>
              </div>

            <div class="rowbottom rightrow">
                <!-- <form class="layui-form searchform"  id="comSearchForm"> -->
                    <div class="layui-btn-group">
                      <button class="layui-btn" id="openstock">开单</button>
                      <button class="layui-btn layui-btn-normal">打单</button>
                    </div>
                <!-- </form>  -->
            </div>

<script id="openbox" type="text/html">
            <div class="alertbox layui-layer-wrap">
                <table class="alerttop" >
                  <tbody>
                    <tr class="tabletitle"><td colspan="2">销售单情况</td></tr>
                    <tr> <td>客户:连云港保丽森实业有限公司</td><td>总金额:304500</td></tr>
                    <tr><td>日起:2017-11-15</td><td>已收金额:304500</td></tr>
                    <tr><td colspan="2">单号:JH-2017-01-07-002</td></tr>
                    <tr><td colspan="2">摘要</td></tr>
                    <tr  class="tabletitle"><td colspan="2">收款过程列表</td></tr>
                  </tbody>
                </table>
                <table class="layui-table" lay-skin="row ">
                  <thead>
                      <tr>
                        <th>行号</th>
                        <th>收款单号</th>
                        <th>收款日期</th>
                        <th>总金额</th>
                        <th>本次收款</th>
                      </tr>
                  </thead>
                  <tbody>
                    
                     <tr>
                      <td>1</td>
                      <td>121231156446</td>
                      <td>2014-02-05</td>
                      <td>10000</td>
                      <td>21246</td>
                    </tr>
                  </tbody>
                </table>
            </div>
</script>
             <script src="../js/jquery-3.2.1.min.js"></script>
             <script src="js/allajax.js"></script>
            <script>

            layui.use(['layer', 'form', 'element','table','laydate'], function(){
                var layer = layui.layer
                ,form = layui.form
                ,element = layui.element
                ,table = layui.table
                ,laydate = layui.laydate;
                laydate.render({
                  elem: '#test1' //指定元素
                });
  
                $("#openstock").click(function(){
                    layer.open({
                      title: '收款过程'
                      ,content:$("#openbox").html()
                      ,skin: 'demo-class'
                      ,btn:["打印","关闭"]
                      ,yes:function(index,layero){
                        //按钮1的回调
                      },btn2:function(index,layero){
                        //按钮2的回调
                      },cancel:function(){
                        //右上关闭的回调
                      }
                    })
                  }); 
  			
  			
  
              var tableArray = new Array()  ;
		        AjaxPostFn('system/repository/out/select?page=1&pagesize=100',"{}",function(jsonData){
		        	if(jsonData.pageInfo.size !=0 ){
		        		$.each(jsonData.pageInfo.list,function(i,obj){
				           	Outobj = obj.bizRepositoryOut;
				           console.log(Outobj)
				              tableArray.push({
				              	"id":Outobj.id,
				              	"menu":"<a class='layui-btn layui-bg-red ' lay-event='DelThis'>删除</a>",
						        "batchId": Outobj.batchId,
						        "fromLocationId": Outobj.fromLocationId,
						        "toLocationId": Outobj.toLocationId,
						        "theNum": Outobj.theNum,
						        "inBatchId": Outobj.inBatchId,
						        "orderNumber": Outobj.orderNumber,
						        "comment": Outobj.comment,
						        "createId": Outobj.createId,
						        "barCode": Outobj.barCode,
						        "createTime": Outobj.createTime,
						        "merchantNumber": Outobj.merchantNumber,
						        "commodityId": Outobj.commodityId,
						        "commodityNumber": Outobj.commodityNumber,
						        "state": Outobj.state,
						        "remarks": Outobj.remarks,
						        "outType": Outobj.outType,
						        "entrustNumber": Outobj.entrustNumber
				              });
				            
				            
				        
				        })
		        	}
		        
		          console.log(tableArray)
		          //展示已知数据
		          table.render({
		              elem: '#SMtable'
		              ,cols: [[ //标题栏
		              	{field:'id',minWidth:'0%',width:'0%',type:'space',style:'display:none'}
		              	,{field:'menu',width:200 , title:'操作'}
		              	,{field:'batchId',width:200 , title:'批次'}
		              	,{field:'fromLocationId',width:200 , title:'出货点编码'}
		              	,{field:'toLocationId',width:200 , title:'出库点编码'}
		              	,{field:'theNum',width:150 , title:'移动产品数量'}
		              	,{field:'inBatchId',width:200 , title:'在批处理id'}
		              	,{field:'orderNumber',width:200 , title:'出货订单号'}
		              	,{field:'comment',width:200 , title:'评论'}
		              	,{field:'createId',width:200 , title:'创建者id'}
		              	,{field:'barCode',width:200 , title:'产品条形码'}
		              	,{field:'createTime',width:200 , title:'出货时间'}
		              	,{field:'merchantNumber',width:200 , title:'商家编号'}
		              	,{field:'commodityId',width:200 , title:'商品id'}
		              	,{field:'commodityNumber',width:200 , title:'商品编码'}
		              	,{field:'state',width:200 , title:'状态'}
		              	,{field:'remarks',width:200 , title:'备注'}
		              	,{field:'outType',width:200 , title:'出库类型'}
		              	,{field:'entrustNumber',width:200 , title:'委托编号'}
						
		              ]]
		              ,data: tableArray
		              ,size:'lg'
		              ,even:true
		              ,page: true //是否显示分页
		          });
		             
		        }); 
		        
		        
		        $('.openwinbtn').on('click', function() {
				    var othis = $(this),
				        method = othis.data('method');
				    active[method] ? active[method].call(this, othis) : '';
				});
						                
				var active = {
				//    弹出框事件
				    addmang:function(){
				    	//iframe层-父子操作
				
						var addindex = layer.open({
						  type: 2,
						  title:"添加销售出库",
						  area: ['100%', '100%'],
						  maxmin: true,
						  shade: 0,
						  content: 'stock_out.html'
						});
						
					}
				}

            }); 

            </script>
        </div>
        <!-- 概述 end-->
    </div>
</body>
</html>